<div class="panel panel-default" ng-controller="BusTaskListCtrl">
	<div class="panel-heading">
		跨城巴士 / 司机任务
	</div>
	<toaster-container toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>
	<div class="row wrapper m-n">
		<form class="bs-example form-horizontal ng-pristine ng-valid">
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.taskNo" class="form-control" placeholder="任务编号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.shift__shiftNo" class="form-control" placeholder="班次号">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.driver__name" class="form-control" placeholder="司机姓名">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.driver__phone" class="form-control" placeholder="司机手机">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.fromCity" class="form-control" placeholder="起始城市">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.toCity" class="form-control" placeholder="目的城市">
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="{{format}}" is-open="opened" ng-model="timeRange.startTime" datepicker-options="dateOptions"
						 close-text="Close" placeholder="任务创建开始时间" readOnly />
						<span class="input-group-btn">
							<button type="button" class="btn btn-default" ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3" ng-controller="DatepickerDemoCtrl">
				<div class="col-md-11">
					<div class="input-group">
						<input type="text" class="form-control" datepicker-popup="{{format}}" is-open="opened" ng-model="timeRange.endTime" datepicker-options="dateOptions"
						 close-text="Close" placeholder="任务创建结束时间" readOnly />
						<span class="input-group-btn">
							<button type="button" class="btn btn-default" ng-click="open($event)">
								<i class="glyphicon glyphicon-calendar"></i>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.fromAddr" class="form-control" placeholder="始发站">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<input type="text" ng-model="queryMap.toAddr" class="form-control" placeholder="终点站">
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<div class="input-group">
						<ui-select ng-model="statusList.selected" theme="bootstrap">
							<ui-select-match placeholder="任务状态">{{$select.selected.name}}</ui-select-match>
							<ui-select-choices repeat="status in statusList | propsFilter: {name: $select.search}">
								<span ng-bind-html=" status.name| highlight: $select.search"></span>
							</ui-select-choices>
						</ui-select>
						<span class="input-group-btn">
							<button ng-click="statusList.selected = undefined" class="btn btn-default">
								<span class="glyphicon glyphicon-trash"></span>
							</button>
						</span>
					</div>
				</div>
			</div>
			<div class="form-group col-md-3">
				<div class="col-md-11">
					<button type="button" class="btn btn-info" ng-click="query()">查询</button>
				</div>
			</div>
		</form>
	</div>
	<div class="table-responsive">
		<table class="table table-striped b-t b-light">
			<thead>
				<tr>
					<th>任务编号</th>
					<th>司机姓名</th>
					<th>司机手机</th>
					<th>任务创建时间</th>
					<th>任务状态</th>
					<th>乘客人数</th>
					<th>起始城市</th>
					<th>目的城市</th>
					<th>始发站</th>
					<th>终点站</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<tr ng-repeat="task in dataList">
					<td>{{task.taskNo}}</td>
					<td>{{task.driver.name}}</td>
					<td>{{task.driver.phone}}</td>
					<td>{{task.createTime | date : 'yyyy-MM-dd HH:mm:ss'}}</td>
					<td>{{task.status | taskFilter}}</td>
					<td>{{task.total}}人</td>
					<td>{{task.fromCity}}</td>
					<td>{{task.toCity}}</td>
					<td>{{task.fromAddr}}</td>
					<td>{{task.toAddr}}</td>
					<td>
						<div class="row list-icon">
							<a href tooltip="取消任务" class="col-sm-4" has-authority="BUS_TASK_UPDATE" ng-if="task.status<4">
								<i class="fa fa-reply fa-fw m-r-xs" ng-click="cancel(task)"></i>
							</a>
							<a href tooltip="详情" class="col-sm-4"
							ui-sref="app.bus.taskDetail({taskId: task.id})" target="_blank">
								<i class="fa icon-info"></i>
							</a>
						</div>
					</td>
				</tr>
				<tr ng-show="dataList.length == 0">
					<td colspan="12" style="text-align: center;">暂无任务信息</td>
				</tr>
			</tbody>
		</table>
	</div>
	<page-footer/>
</div>